﻿namespace Attacher
{
    using System.Collections.ObjectModel;

    public class SelectInstanceWindowViewModel : PropertyChangedNotifier
    {
        #region Attributes

        private VisualStudioInstanceViewModel selectedInstance;

        #endregion

        #region Properties

        public ObservableCollection<VisualStudioInstanceViewModel> Instances { get; private set; }

        public VisualStudioInstanceViewModel SelectedInstance
        {
            get
            {
                return this.selectedInstance;
            }
            set
            {
                if (this.selectedInstance != value)
                {
                    this.selectedInstance = value;
                    base.OnPropertyChanged("SelectedInstance");
                }
            }
        }

        #endregion

        #region Public Methods

        public SelectInstanceWindowViewModel(ObservableCollection<VisualStudioInstanceViewModel> instances)
        {
            ParameterChecker.IsNotNull(instances, "instances");

            this.Instances = instances;
        }

        #endregion
    }
}
